<!DOCTYPE html >
<html>
<head>
    <meta name="Generator" content="ECSHOP v2.7.3"/>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <title>全部商品 </title>
    <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon"/>
    <meta name="Keywords" content=""/>
    <meta name="Description" content=""/>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <link rel="stylesheet" type="text/css" href="/template/default/css/public.css"/>
    <link rel="stylesheet" href="/template/default/css/flow.css">
    <link rel="stylesheet" type="text/css" href="/template/default/css/goods.css"/>
    <link rel="stylesheet" type="text/css" href="/template/default/css/list.css"/>
    <link rel="stylesheet" type="text/css" href="/template/default/css/category_list.css"/>
    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/jquery/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="/template/default/js/jquery.json.js"></script>
    <script type="text/javascript" src="/template/default/js/transport.js"></script>
    <script type="text/javascript" src="/template/default/js/common.js"></script>
    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/layer/layer.js"></script>

    <!--<script type="text/javascript" src="/template/default/js/product.js"></script>
    <script type="text/javascript" src="/res/js/jquery.metadata.js"></script>-->
    <!--dropload-->
    <script type="text/javascript" src="/res/plugins/dropload/js/dropload.min.js"></script>
    <link type="text/css" rel="stylesheet" href="/res/plugins/dropload/css/dropload.css"/>
    <style>
        .touchweb-com_searchListBox.openList .item {
            border-right: 2.5px solid #f8f8f8;
            border-top: 5px solid #f8f8f8;
        }

        .touchweb-com_searchListBox .item {
            border-bottom: 0;
            background: #fff;
        }

        .touchweb-com_searchListBox.openList .item .pic_box {
            margin-bottom: 0;
        }

        .lists {
            padding: 0 10px;
        }

        .touchweb-com_searchListBox.openList .item .pic_box:after {
            content: '';
            padding-top: 86%;
        }

        .touchweb-com_searchListBox .item .title_box {
            height: 36px;
            margin-top: 5px;
        }

        .touchweb-com_searchListBox.openList .item .title_box {
            margin-bottom: 0;
        }
.title_box{
    font-family: STHeitiSC-Light;
    font-size: 18px;
    color: #333333;
    letter-spacing: 0;
    line-height: 18px;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-all;
    white-space: normal !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
        .touchweb-com_searchListBox .bug_car i {
            background-size: 22px 22px;
        }

        .dropload-down {
            display: none;
        }

        .touchweb-com_searchListBox.openList li:nth-child(even) .item {
            border-right: 0;
            border-left: 2.5px solid #f8f8f8;
        }

        .touchweb-com_searchListBox.openList .bug_car {
            bottom: 7px;
        }

        .touchweb-com_searchListBox .item:active {
            background-color: #ffffff;
        }

        .WX_search_btn_blue {
            border: none;
            height: 29px;
            line-height: 29px;
            position: relative;
            top: -3px;
        }

        .WX_me {
            right: 10px;
        }

        .WX_search_txt {
            width: 81%;
        }

        .h-left {
            width: 7%;
        }

        .h-left a {
            background-position: 15px 15px;
        }

        .touchweb-com_searchListBox li {
            margin-bottom: 5px;
        }

        .touchweb-com_searchListBox .item .price_box {
            position: absolute;
            bottom: 10px;
            left: 111px;
        }

        .openList li {
            margin-bottom: 0;
        }

        .openList .item .price_box {
            position: static;
        }

        .discount {
            color: #E24615;
            font-size: 18px;
        }

        .color-red {
            color: #E24615;
            margin-left: 10px;
        }
    </style>
</head>
<body>
<section class="_pre">
    <header>
        <section class="header">
            <div class="h-left"><a class="sb-back" href="javascript:history.back(-1)" title="返回">
                <img src="/template/default/images/arrow_left_black.png">
            </a></div>
            <div class="h-mid" style="width: 93%">
                <div class="WX_search1" style="float:left; width:100%" id="mallHead">
                    <form class="WX_search_frm1" action="/b/product/goodList" id="searchForm" name="searchForm">
                        <input type="hidden" name="shopId" value="${shopId!}"/>
                        <input name="keyword" id="search_word" class="WX_search_txt hd_search_txt_null"
                               placeholder="请输入商品名进行搜索！" ptag="37080.5.2" type="search" value="${keyword!}"
                               AUTOCOMPLETE="off"/>
                        <div class="WX_me">
                            <button type="submit" class="WX_search_btn_blue">搜索</button>
                        </div>
                    </form>
                </div>
            </div>
            <section class="filtrate_term" id="product_sort" style="width: 100%;">
                <ul>
                    <li style="width: 40%"
                    <%if(sort=="1"){%>
                    class='time on'
                    <%}else{%>
                    class='time'
                    <%}%>
                    ><a href="/b/product/goodListForm?shopId=${shopId!}&sort=1&sortType1=${sortType1!}&productCategory_id=${productCategory_id!}&keyword=${keyword!}">新品
                </a>
                    </li>
                    <li style="width: 40%;"
                    <%if(sort=="2"){%>
                    class='price on'
                    <%}else{%>
                    class='price'
                    <%}%>
                    ><a href="/b/product/goodListForm?shopId=${shopId!}&sort=2&sortType2=${sortType2!}&productCategory_id=${productCategory_id!}&keyword=${keyword!}">价格
                    <span class="arrow_up <%if(sortType2==" asc"){%>active_up<%}%>"></span><span
                            class="arrow_down <%if(sortType2==" desc"){%>active_down<%}%>"></span>
                </a></li>
                    <li class="" style="width: 18%"><a href="javascript:void(0);"
                                                       class="show_type show_list ">&nbsp;</a></li>
                </ul>
            </section>
        </section>
    </header>
    <section>
        <div style="height:45px;"></div>
        <div class="touchweb-com_searchListBox openList " id="goods_list">
            <form action="javascript:void(0)" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY">
                <div class="content">
                    <ul class="lists">

                    </ul>
                </div>
            </form>
        </div>
    </section>
</section>
<%include("footer_sys.html"){}%>
</body>
<script>
    $('.show_type').bind("click", function () {
        if ($('#goods_list').hasClass('openList')) {
            $('#goods_list').removeClass('openList');
            $(this).removeClass('show_list');
        }
        else {
            $('#goods_list').addClass('openList');
            $(this).addClass('show_list');
        }
    });
</script>
<script>
    $(function () {
        // 页数
        var page = 0;
        // 每页展示5个
        var size = 10;
        // dropload
        $('.content').dropload({
            scrollArea: window,
            loadDownFn: function (me) {
                page++;
                // 拼接HTML
                var result = '';
                $.ajax({
                    type: 'GET',
                    url: '/b/product/ajaxgoodListAll',
                    data: {
                        "pageNumber": page,
                        "pageSize": size,
                        "shopId": "${shopId!}",
                        "keyword": "${keyword!}",
                        "productCategory_id": "${productCategory_id!}",
                        "sort": "${sort!}",
                        "sortType0": "${sortType0!}",
                        "sortType1": "${sortType1!}",
                        "sortType2": "${sortType2!}",

                    },
                    success: function (r) {//alert(r.data.pager.list.length);
                        if (r.data.pager.list.length > 0) {//alert(1);
                            //alert(eval(r.data.pager.list[0].productImageListStore)[0].bigProductImagePath);
                            $.each(r.data.pager.list, function (k, v) {
                                result += '<li>';
                                result += '<a href="/b/product/detailWap?id=' + v.id + '&shopId=${shopId!}&keyword=${keyword!}" class="item">';
                                result += '<div class="pic_box">';
                                result += '<img src=' + ((v.productImageListStore == null) ? "" : (eval(v.productImageListStore)[0].sourceProductImagePath)) + '>';
                                result += '</div>';
                                result += '<div class="title_box">' + v.name + '</div>';

                                result += '<div class="price_box"><span class="new_price"><i>￥' + v.price + '</i></span>';
                                if (v.productRebatePercentMoney != '' &&
                                    v.productRebatePercentMoney != 0.00 &&
                                    v.productRebatePercentMoney) {

                                    result += "  <span class=\"color-red\">返现￥<span\n" +
                                        " class=\"discount\">" + v.productRebatePercentMoney + "</span></span>";
                                }
                                result += '</div></a>';

                                result += '</li>';

                            })
                        } else {
                            // 锁定
                            me.lock();
                            // 无数据
                            me.noData();
                        }
                        // 为了测试，延迟1秒加载
                        setTimeout(function () {
                            // 插入数据到页面，放到最后面
                            $('.lists').append(result);
                            // 每次数据插入，必须重置
                            me.resetload();
                        }, 10);
                    },
                    /*error: function(xhr, type){
                        //alert('Ajax error!');
                        // 即使加载出错，也得重置
                        me.resetload();
                    }*/
                });
            }
        });
    });
</script>

<!--购物车项,由于异步加载原因,在此写-->
<script>
    function addCartItem(id) {
        var id = id;
        var quantity = $("#quantity").val();
        if (quantity == null) {
            quantity = 1;
        }
        $.ajax({
            url: "/b/cartItem/ajaxAdd",
            data: {"id": id, "quantity": quantity},
            dataType: "json",
            success: function (data) {
                if (data.status == "success") {
                    if (data.returnUrl != "" && data.returnUrl != undefined) {
                        window.location.href = data.returnUrl
                    } else {
                        $("#ECS_CARTINFO").html(data.totalQuantity);
                        //layer.msg(data.message);
                        layer.open({
                            content: data.message
                            , btn: '确定'
                        });

                    }
                } else if (data.status == "error") {
                    layer.msg(data.message);
                    //alert(data.message);
                }
            }
        });
    }
</script>
</html>